package com.trigsoft.utils;

import android.app.ProgressDialog;
import android.content.Context;

public class ProgressDialogUtils
{
	public static ProgressDialog show(Context context, Integer message)
	{
		return show(context, context.getString(message));
	}

	public static ProgressDialog show(Context context, String message)
	{

		ProgressDialog dialog = new ProgressDialog(context);
		dialog.setMessage(message);
		dialog.setCancelable(false);
		dialog.show();
		return dialog;
	}

	public static ProgressDialog show(ProgressDialog dialog, Context context, Integer title, Integer message)
	{
		return show(dialog, context, context.getString(title), context.getString(message));
	}

	public static ProgressDialog show(ProgressDialog dialog, Context context, String title, String message)
	{
		if (dialog == null)
		{
			dialog = new ProgressDialog(context);
		}
		dialog.setTitle(title);
		dialog.setMessage(message);
		dialog.setCancelable(false);
		dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
		dialog.setProgress(0);
		dialog.setMax(0);
		dialog.show();
		return dialog;
	}

}
